Skip to content

fix: clean up instance remove lifecycle hooks - #9085

Merged
limzykenneth merged 2 commits into
processing:mainfrom
slash-init:fix/lifecycle-hooks-remove-cleanup
Aug 26, 2026
Merged

fix: clean up instance remove lifecycle hooks#9085
limzykenneth merged 2 commits into
processing:mainfrom
slash-init:fix/lifecycle-hooks-remove-cleanup

Conversation

@slash-init

Copy link
Copy Markdown
Contributor

Resolves #9072

Changes:

Replaced the instance-specific lifecycle hook named remove that was used for clearing the focus and blur event listeners with the signal from the existing AbortController.
This stops the function p5.lifecycleHooks.remove from accumulating hooks when p5 instances are removed. I've also added a regression test to ensure that the hooks are cleaned up after the instances have been removed.

Screenshots of the change:

Not applicable.

PR Checklist

@slash-init slash-init changed the title Fix/lifecycle hooks remove cleanup fix: clean up instance remove lifecycle hooks Aug 16, 2026
@limzykenneth
limzykenneth force-pushed the fix/lifecycle-hooks-remove-cleanup branch from 86fdbcc to b228885 Compare August 26, 2026 05:03
@p5-bot

p5-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: b228885

Previous deployments

86fdbcc


This is an automated message.

@limzykenneth
limzykenneth merged commit 19ba7dc into processing:main Aug 26, 2026
4 checks passed
@limzykenneth

Copy link
Copy Markdown
Member

Looks good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[p5.js 2.0+ Bug Report]: remove() accumulates lifecycle hooks across instances

2 participants